...and use it in GailRange and GailSpinButton. Bug 625953.
GValue *value);
static void gail_adjustment_get_minimum_value (AtkValue *obj,
GValue *value);
+static void gail_adjustment_get_minimum_increment (AtkValue *obj,
+ GValue *value);
static gboolean gail_adjustment_set_current_value (AtkValue *obj,
const GValue *value);
iface->get_current_value = gail_adjustment_get_current_value;
iface->get_maximum_value = gail_adjustment_get_maximum_value;
iface->get_minimum_value = gail_adjustment_get_minimum_value;
+ iface->get_minimum_increment = gail_adjustment_get_minimum_increment;
iface->set_current_value = gail_adjustment_set_current_value;
}
g_value_set_double (value, minimum_value);
}
+static void
+gail_adjustment_get_minimum_increment (AtkValue *obj,
+ GValue *value)
+{
+ GtkAdjustment* adjustment;
+ gdouble minimum_increment;
+
+ adjustment = GAIL_ADJUSTMENT (obj)->adjustment;
+ if (adjustment == NULL)
+ {
+ /* State is defunct */
+ return;
+ }
+
+ if (adjustment->step_increment != 0 &&
+ adjustment->page_increment != 0)
+ {
+ if (ABS (adjustment->step_increment) < ABS (adjustment->page_increment))
+ minimum_increment = adjustment->step_increment;
+ else
+ minimum_increment = adjustment->page_increment;
+ }
+ else if (adjustment->step_increment == 0 &&
+ adjustment->page_increment == 0)
+ {
+ minimum_increment = 0;
+ }
+ else if (adjustment->step_increment == 0)
+ {
+ minimum_increment = adjustment->page_increment;
+ }
+ else
+ {
+ minimum_increment = adjustment->step_increment;
+ }
+
+ memset (value, 0, sizeof (GValue));
+ g_value_init (value, G_TYPE_DOUBLE);
+ g_value_set_double (value, minimum_increment);
+}
+
static gboolean
gail_adjustment_set_current_value (AtkValue *obj,
const GValue *value)
GValue *value);
static void gail_range_get_minimum_value (AtkValue *obj,
GValue *value);
+static void gail_range_get_minimum_increment (AtkValue *obj,
+ GValue *value);
static gboolean gail_range_set_current_value (AtkValue *obj,
const GValue *value);
static void gail_range_value_changed (GtkAdjustment *adjustment,
iface->get_current_value = gail_range_get_current_value;
iface->get_maximum_value = gail_range_get_maximum_value;
iface->get_minimum_value = gail_range_get_minimum_value;
+ iface->get_minimum_increment = gail_range_get_minimum_increment;
iface->set_current_value = gail_range_set_current_value;
}
atk_value_get_minimum_value (ATK_VALUE (range->adjustment), value);
}
+static void
+gail_range_get_minimum_increment (AtkValue *obj, GValue *value)
+{
+ GailRange *range;
+
+ g_return_if_fail (GAIL_IS_RANGE (obj));
+
+ range = GAIL_RANGE (obj);
+ if (range->adjustment == NULL)
+ /*
+ * Adjustment has not been specified
+ */
+ return;
+
+ atk_value_get_minimum_increment (ATK_VALUE (range->adjustment), value);
+}
+
static gboolean gail_range_set_current_value (AtkValue *obj,
const GValue *value)
{
GValue *value);
static void gail_spin_button_get_minimum_value (AtkValue *obj,
GValue *value);
+static void gail_spin_button_get_minimum_increment (AtkValue *obj,
+ GValue *value);
static gboolean gail_spin_button_set_current_value (AtkValue *obj,
const GValue *value);
static void gail_spin_button_value_changed (GtkAdjustment *adjustment,
iface->get_current_value = gail_spin_button_get_current_value;
iface->get_maximum_value = gail_spin_button_get_maximum_value;
iface->get_minimum_value = gail_spin_button_get_minimum_value;
+ iface->get_minimum_increment = gail_spin_button_get_minimum_increment;
iface->set_current_value = gail_spin_button_set_current_value;
}
atk_value_get_minimum_value (ATK_VALUE (spin_button->adjustment), value);
}
+static void
+gail_spin_button_get_minimum_increment (AtkValue *obj, GValue *value)
+{
+ GailSpinButton *spin_button;
+
+ g_return_if_fail (GAIL_IS_SPIN_BUTTON (obj));
+
+ spin_button = GAIL_SPIN_BUTTON (obj);
+ if (spin_button->adjustment == NULL)
+ /*
+ * Adjustment has not been specified
+ */
+ return;
+
+ atk_value_get_minimum_increment (ATK_VALUE (spin_button->adjustment), value);
+}
+
static gboolean
gail_spin_button_set_current_value (AtkValue *obj,
const GValue *value)